package com.dq.Week2.day09.pritice;

import java.util.Comparator;

public class HeroComparator implements Comparator<Hero> {


    @Override
    public int compare(Hero o1, Hero o2) {




      int num1 = o1.getHp() - o2.getHp();
      int num2 = num1==0?o1.getAtk()-o2.getAtk():num1;

      return num2;

    }
}
